﻿<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" CodeBehind="advancedsearch_parameter.aspx.cs" Inherits="YXShop.Web.admin.templates.lable.advancedsearch_parameter" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../style/admin.css" rel="stylesheet" type="text/css" />
 <script language="JavaScript" type="text/javascript" src="../../../configuration/js/Prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="../../../configuration/js/Public.js"></script>
<script src="../../../editor/fckeditor.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">

function ReturnValue()
{
       //自定义内容
    var mystyle = document.getElementById("txtLabelContent").value;	
	var cnm ="[YX:unLoop,YX:LableType=Search,YX:Option=ProductSearch]"+mystyle+"[/YX:unLoop]";
    parent.getValue(cnm);
	 CloseDiv();

}

    function getValue(value)
    {
        var textObj=document.getElementById("txtLabelContent");
        var textFeildValue=value;
        if(value!="") 
        {
            if(document.all)
            {     
                if(textObj.createTextRange && textObj.caretPos)
                {   
                    var caretPos=textObj.caretPos;   
                    caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==''?textFeildValue+'':textFeildValue;   
                }
                else
                {   
                    textObj.value=textFeildValue;   
                }   
            }
            else
            {   
                if(textObj.setSelectionRange)
                {   
                    var rangeStart =textObj.selectionStart;   
                    var rangeEnd=textObj.selectionEnd;   
                    var tempStr1=textObj.value.substring(0,rangeStart);   
                    var tempStr2 =textObj.value.substring(rangeEnd);   
                    textObj.value=tempStr1+textFeildValue+tempStr2;   
                }
                else
                {   
                    alert("This version of Mozilla based browser does not support setSelectionRange");   
                }   
            }
        }
    }
    function setCaret(textObj)
    {   
        if(textObj.createTextRange)
        {   
            textObj.caretPos=document.selection.createRange().duplicate();   
        }   
    } 
function CloseDiv()
{
    parent.document.getElementById("LabelDivid").style.display="none";
}

</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table class="table_label_parameter" cellpadding="1" cellspacing="1" style="width: 99%; margin-top:5px">
          
            <tr>
                <td>
                    搜索条件</td>
                <td>
                  <asp:DropDownList ID="dd_Condtion" runat="server" Height="25px" Width="151px" 
                        onchange="javascript:getValue(this.value);">
                        <asp:ListItem Value="">--请选择搜索条件--</asp:ListItem>
                        <asp:ListItem Value="[#Cond_Key]">关键字</asp:ListItem>
                        <asp:ListItem Value="[#Cond_ProName]">商品名称</asp:ListItem>
                        <asp:ListItem Value="[#Cond_ProClass]">商品类别</asp:ListItem>
                        <asp:ListItem Value="[#Cond_ProBrand]">商品品牌</asp:ListItem>
                        <asp:ListItem Value="[#Cond_Price]">商品价格范围</asp:ListItem>
                        <asp:ListItem Value="[#Cond_State]">商品状态</asp:ListItem>
                        <asp:ListItem Value="[#Cond_Content]">商品简介</asp:ListItem>
                        <asp:ListItem Value="[#Cond_No]">商品编号</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    操作方式</td>
                <td>
                    <asp:DropDownList ID="ddl_Option" runat="server" Height="25px" Width="142px"  onchange="javascript:getValue(this.value);" >
                     <asp:ListItem Value="">--请选择操作方式--</asp:ListItem>
                        <asp:ListItem Value="[#Option_Src]">搜索按钮</asp:ListItem>
                        <asp:ListItem Value="[#Option_Reste]">重置按钮</asp:ListItem>
                      <%--  <asp:ListItem Value="[#Option_Favorites]">搜索链接</asp:ListItem>--%>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                
                <td colspan="4">
                    <asp:TextBox runat="server" ID="txtLabelContent" height="100" onselect="setCaret(this);"  onclick="setCaret(this);"  onkeyup="setCaret(this);" Width="600" TextMode="MultiLine"></asp:TextBox>
                     </td>
            </tr>
            
            <tr>
                <td colspan="4" align="center" style="text-align:center">
                   <input id="bt_Exc" type="button" value="提交" onclick="ReturnValue()" />
                    &nbsp;<input class="form" type="button" value=" 关 闭 "  onclick="javascript:CloseDiv();" /></td>
            </tr>
            </table>
    </div>
    </form>
</body>
</html>